<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三级联动</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="app">
        <select v-model="cityList">
            <option value="">请选择省份</option>
            <option v-for="item in  list" :value="item.list">
                {{item.name}}
            </option>
        </select>

        <select v-model="townList">
            <option value="">请选择城市</option>
            <option v-for="item in cityList" :value="item.list">
                {{item.name}}
            </option>
        </select>
        <select >
            <option value="">请选择区县</option>
            <option v-for="item in townList" :value="item.id">
                {{item.name}}
            </option>
        </select>
    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            list: [{ id: 1, name: "湖北", list: [{ id: 11, name: "武汉", list: [{ id: 111, name: "江夏" }, { id: 112, name: "洪山" }] }, { id: 12, name: "荆州", list: [{ id: 121, name: "沙市" }, { id: 122, name: "松滋" }] }] }, { id: 2, name: "河南", list: [{ id: 21, name: "郑州", list: [{ id: 211, name: "新郑" }, { id: 212, name: "金水" }] }, { id: 22, name: "洛阳", list: [{ id: 221, name: "孟津" }, { id: 222, name: "洛阳的区二" }] }] }, { id: 3, name: "湖南", list: [{ id: 31, name: "长沙", list: [{ id: 311, name: "雨花" }, { id: 312, name: "岳麓山" }] }, { id: 32, name: "岳阳", list: [{ id: 321, name: "岳阳楼" }, { id: 322, name: "岳阳的区二" }] }] }],
            cityList:"",
            townList:"",
        },
        watch:{
            cityList(){
                this.townList = "";
            }
           
        }
    })

</script>

</html>